<?php if($files):?>
	<ul class="image_gallery">
	<?php foreach($files as $key => $file): ?>
	<li><a href="javascript:void(0);" onclick="javascript:insertImage('<?php echo $file->filename; ?>', '<?php echo htmlentities($file->name); ?>');"><img title="<?php echo $file->name; ?>" width="64" src="<?php echo site_url('files/thumb/' . $file->id . '/64/64?'. rand(0, 99)); ?>" alt="<?php echo $file->name; ?>" /></a><br /><?php echo $file->name; ?></li>
	<?php endforeach;?>
	</ul>
	<div align=center><div class="inner"><?php $this->load->view('partials/pagination'); ?></div></div>
	<script type="text/javascript">
		jQuery(function($){
			$('.paginate a').ezjax({ container: '.gallery_warpper', initial: null, effect: 'fade', easing: 'easeOutBounce'});
		});
	</script>
<?php else:?>
	<div style="margin:20px;">No Files</div>
<?php endif;?>
